package com.game.majiang.config;

import java.io.PrintWriter;
import java.io.StringWriter;

import lombok.extern.log4j.Log4j;

@Log4j
public class LogManager {
		private static LogManager instance;
		public static LogManager getInstance() {
			if (instance == null) instance = new LogManager();
			return instance;
		}
		public boolean isopen = true;
		public void Log(String str)
		{
			if(isopen)
			{
				log.info(str);
			}      
		}
		public void Error(String str)
		{
			log.error(str);
		}


		public void errorLog(Exception msg) {
			StringWriter errors = new StringWriter();
			msg.printStackTrace(new PrintWriter(errors));
			log.info(" exception:"+msg.getMessage()+"\t"+errors.toString()+"    .......");
		}
}
